package com.ruoyi.video.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.video.domain.VideoAnalysisUser;
import com.ruoyi.video.service.IVideoAnalysisUserService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 视频解析Controller
 * 
 * @author ruoyi
 * @date 2025-10-06
 */
@RestController
@RequestMapping("/video/VideoAnalysisUser")
public class VideoAnalysisUserController extends BaseController
{
    @Autowired
    private IVideoAnalysisUserService videoAnalysisUserService;

    /**
     * 查询视频解析列表
     */
    @PreAuthorize("@ss.hasPermi('video:VideoAnalysisUser:list')")
    @GetMapping("/list")
    public TableDataInfo list(VideoAnalysisUser videoAnalysisUser)
    {
        startPage();
        List<VideoAnalysisUser> list = videoAnalysisUserService.selectVideoAnalysisUserList(videoAnalysisUser);
        return getDataTable(list);
    }

    /**
     * 导出视频解析列表
     */
    @PreAuthorize("@ss.hasPermi('video:VideoAnalysisUser:export')")
    @Log(title = "视频解析", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, VideoAnalysisUser videoAnalysisUser)
    {
        List<VideoAnalysisUser> list = videoAnalysisUserService.selectVideoAnalysisUserList(videoAnalysisUser);
        ExcelUtil<VideoAnalysisUser> util = new ExcelUtil<VideoAnalysisUser>(VideoAnalysisUser.class);
        util.exportExcel(response, list, "视频解析数据");
    }

    /**
     * 获取视频解析详细信息
     */
    @PreAuthorize("@ss.hasPermi('video:VideoAnalysisUser:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
//        return success(videoAnalysisUserService.selectVideoAnalysisUserById(id));
        return null;
    }

    /**
     * 新增视频解析
     */
    @PreAuthorize("@ss.hasPermi('video:VideoAnalysisUser:add')")
    @Log(title = "视频解析", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody VideoAnalysisUser videoAnalysisUser)
    {
        return toAjax(videoAnalysisUserService.insertVideoAnalysisUser(videoAnalysisUser));
    }

    /**
     * 修改视频解析
     */
    @PreAuthorize("@ss.hasPermi('video:VideoAnalysisUser:edit')")
    @Log(title = "视频解析", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody VideoAnalysisUser videoAnalysisUser)
    {
        return toAjax(videoAnalysisUserService.updateVideoAnalysisUser(videoAnalysisUser));
    }

    /**
     * 删除视频解析
     */
    @PreAuthorize("@ss.hasPermi('video:VideoAnalysisUser:remove')")
    @Log(title = "视频解析", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(videoAnalysisUserService.deleteVideoAnalysisUserByIds(ids));
    }
}
